﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Web;
using System.Web.UI;
using System.Web.UI.WebControls;
using Bussiness;

namespace WebApplication.Admin
{
    public partial class WebForm1 : System.Web.UI.Page
    {
        protected void Page_Load(object sender, EventArgs e)
        {

        }
        public void loadMh()
        {
            IUnitOfWork iunitfwork = new EFUnitOfWork();
            MATHANGRepository repository = new MATHANGRepository(new EFRepository<MATHANG>(), iunitfwork);
            IQueryable<MATHANG> objmathang = repository.All();
            
        }
        protected void GridView1_RowDataBound(object sender, GridViewRowEventArgs e)
        {
             IUnitOfWork iunitfwork = new EFUnitOfWork();
            MATHANGRepository repository = new MATHANGRepository(new EFRepository<MATHANG>(), iunitfwork);
            IQueryable<MATHANG> objmathang = repository.All();
            DropDownList Dlmathang = ((DropDownList)e.Row.FindControl("Dlmathang"));
            if (Dlmathang != null)
            {
                Dlmathang.DataSource = objmathang;
                Dlmathang.DataBind();
            }
        }
    }
}